package priv.yiyuan.example.design.pay;

import java.util.Map;

/**
 * 信用卡支付处理类
 * <p>
 * 接口部分实现类
 */
public class CreditCardProcessor implements PaymentProcessor {

    @Override
    public boolean processPayment(double amount, Map<String, String> paymentDetails) {

        System.out.println(String.format("信用卡支付: 金额 %.2f, 卡号 %s, 有效期 %s\n",
                amount, paymentDetails.get("cardNumber"), paymentDetails.get("expiryDate")));

        return true;
    }

    @Override
    public boolean refund(double amount, String transactionId) {

        System.out.println(String.format("信用卡退款: 金额 %.2f, 支付宝账号 %s \n", amount, transactionId));

        return true;
    }
}
